<template>
	<view>
		<view class="bucket-info">
			<view class="title">设备桶信息</view>
			<view class="u-f-jsb">
				<view>所属加注站</view>
				<view>{{ detail.siteName }}</view>
			</view>
			<view class="u-f-jsb">
				<view>设备桶名称</view>
				<view>{{ detail.macName || detail.name }}</view>
			</view>
			<view class="u-f-jsb">
				<view>设备桶容量(吨)</view>
				<view>{{ detail.totalCapacity | kg2ton }}</view>
			</view>
			<view class="u-f-jsb" v-if="detail.actualPreWeight">
				<view>补液前余量(吨)</view>
				<view>{{ detail.actualPreWeight | kg2ton }}</view>
			</view>
			<!-- <view class="u-f-jsb" v-if="detail.iotPreWeight">
				<view>补液前传感器余量(吨)</view>
				<view>{{ detail.iotPreWeight | kg2ton || '---' }}</view>
			</view> -->
		</view>
		<view class="supply-info">
			<view class="title">补液信息</view>
			<view class="u-f-jsb" v-if="detail.recordType === 1">
				<view>补液单号</view>
				<view>{{ detail.fill_task_id }}</view>
			</view>
			<view class="u-f-jsb">
				<view>补液类型</view>
				<view>{{ detail.recordType === 0 ? '手工补液' : '自动补液' }}</view>
			</view>
			<view class="u-f-jsb">
				<view>本次补液量(吨)</view>
				<view>{{ detail.recordNum | kg2ton }}</view>
			</view>
			<view class="u-f-jsb">
				<view>补液后余量(吨)</view>
				<view>{{ detail.actualRestWeight | kg2ton }}</view>
			</view>
			<!-- <view class="u-f-jsb">
				<view>补液后传感器余量(吨)</view>
				<view>{{ detail.iotLastWeight | kg2ton || '---' }}</view>
			</view> -->
			<view class="u-f-jsb">
				<view>补液完成时间</view>
				<view>{{ detail.recordTime }}</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			detail: {}
		};
	},
	onLoad(options) {
		this.recordId = options.recordId || '';
		this.getDatail();
	},
	methods: {
		getDatail() {
			this.$u.api._getRecordDetail({ recordId: this.recordId }).then(res => {
				console.log(res);
				this.detail = res;
			});
		},
		goback() {
			uni.navigateBack();
		}
	}
};
</script>

<style lang="scss">
.bucket-info,
.supply-info {
	padding: 30rpx;

	> view {
		padding: 10rpx 0;
		> view:nth-child(1) {
			color: #808080;
		}
	}
	.title {
		font-weight: 800;
		font-size: 36rpx;
	}
}
</style>
